import request from '@/utils/request'

// 查询物料分类列表
export function listCategory(query) {
  return request({
    url: '/purchase/category/list',
    method: 'get',
    params: query
  })
}

// 查询物料分类详细
export function getCategory(cId) {
  return request({
    url: '/purchase/category/' + cId,
    method: 'get'
  })
}

// 新增物料分类
export function addCategory(data) {
  return request({
    url: '/purchase/category',
    method: 'post',
    data: data
  })
}

// 修改物料分类
export function updateCategory(data) {
  return request({
    url: '/purchase/category',
    method: 'put',
    data: data
  })
}

// 删除物料分类
export function delCategory(cId) {
  return request({
    url: '/purchase/category/' + cId,
    method: 'delete'
  })
}

//级联
export function getLevel() {
    return request({
      url: '/purchase/category/getLevel',
      method: 'GET'
    })
  }
  
  
